// page/exploer/exploer.js
const api = require('../../utils/api.js');

Page({
    data: {
        banners: [],
		areaList: [],
		indicatorDots: true,
		indicatorColor: '#4abdcc',
		indicatorAcolor: '#fff',
		autoplay: true,
		circular: true
    },
    onLoad: function(options) {
        let self = this;
		api.destination.list((state,res) => {
			if(state === 'success'){
				// console.log(res.data);
				let banners = res.data.banners;
				let areaList = res.data.elements;
				self.setData({
					banners,
					areaList
				})
			}
		})
    },
	goPos: function(e){
		let dataPos = e.currentTarget.dataset;
		wx.navigateTo({
			url: `../destination/destination?id=${dataPos.id}&name=${dataPos.name}&typ=${dataPos.typ}`,
		})
	}
})